#ifndef DIJKSTRA_H_
#define DIJKSTRA_H_

#include <vector>

#include "interface/common.h"

// 定义节点结构体
struct Node {
    Point position;
    int   cost;
    int   turnCount;
    Node* parent;

    Node(Point pos, int c, int turns, Node* p) : position(pos), cost(c), turnCount(turns), parent(p) {}

    bool operator>(const Node& other) const {
        if (cost == other.cost) {
            return turnCount > other.turnCount;
        }
        return cost > other.cost;
    }
};

std::vector<Point> DijkstraPlan(const std::vector<std::vector<int>>& grid, const Point& start, const Point& goal);

#endif